package lambda.string;

public class StartsWithDemo {
    public static void main(String[] args) {

        // 判断是否以www开头
        String str = "www.tedcnu.cn";
        boolean starts = str.startsWith("www");
        System.out.println("starts:"+starts);
        // 判断是否以.cn结尾
        boolean ends = str.endsWith(".cn");
        System.out.println("ends:"+ends);
    }
}
